package org.vt.scheduleapp;


import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;

public class RingerTestingActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.buttonfile);
        
        //b1 to set normal ringer
        ImageButton b1 = (ImageButton)findViewById(R.id.FullSound);
        //b2 to set silent ringer
	    ImageButton b2 = (ImageButton)findViewById(R.id.Silent);
	    //3 to set a vibrate ringer
	    ImageButton b3 = (ImageButton)findViewById(R.id.Vibrate);
        
        
	    final AudioManager audMangr;
	    audMangr= (AudioManager) getBaseContext().getSystemService(Context.AUDIO_SERVICE);
	    
	    b1.setOnClickListener(new OnClickListener()
	    {
	    	public void onClick(View view)
	    	{
	    	audMangr.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
	    	}
	    });
	    
	    b2.setOnClickListener(new OnClickListener()
	    {
	    	public void onClick(View view)
	    	{
	    	audMangr.setRingerMode(AudioManager.RINGER_MODE_SILENT);	
	    	}
	    });
	    
	    b3.setOnClickListener(new OnClickListener()
	    {
	    	public void onClick(View view)
	    	{
	    	audMangr.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);
	    	}
	    });
        
    }
}